package com.bite.demo.dao;

import com.bite.demo.model.BookInfo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class BookDao {
    public List<BookInfo> mockDta() {
        List<BookInfo> bookInfos = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setBookId(i);
            bookInfo.setBookName("图书" + i);
            bookInfo.setAuthor("作者" + i);
            bookInfo.setNum(15 * i + 1);
            bookInfo.setPrice(new BigDecimal(new Random().nextInt(100) + 1));
            bookInfo.setPublishName("出版社" + i);
            bookInfo.setState(i % 5 == 0 ? 2 : 0);
            bookInfos.add(bookInfo);
        }
        return bookInfos;
    }
}
